<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head lang="en">
    <meta charset="UTF-8"/>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
        function queryDeviceRecords(pageNum) {
            var id=$("#deviceId").val();
            $("#paging").load("<%=basePath %>/maindevice/query.html?id="+id+"&pageNum=" + pageNum);
        }

        function delAllData(){
            var msg = "您真的确定要删除吗？\n\n请确认！";
            if (confirm(msg)==true){
                return true;
            }else{
                return false;
            }
        }
    </script>
    <title>查询记录</title>
</head>
<body>




<div class="row" id="deviceRecordList">
    <div class="col-lg-12" style="height: 15px;top:700px" id="paging">
        <div class="panel">
            <div class="panel-heading bk-bg-primary">
                <h6><i class="fa fa-table red"></i><span class="break"></span>使用记录列表</h6>

                <div class="panel-actions">
                    <a href="table.html#" class="btn-setting"><i class="fa fa-rotate-right"></i></a>
                    <a href="table.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a>
                </div>
                <form action="/goodsinfo/query/1" method="get">
                    产品编号<input type="text" name="goodsId" id="goodsId"/>    商品类型编号<input type="text" name="goodsTypeId" id="goodsTypeId"/>
                    <input type="submit" value="查询">
                </form>
                <a href="/goodsinfo/del/all" onclick="javascript:return delAllData()">清空商品信息</a>    <a href="/goodsinfo/query/1">返回</a>
            </div>
            <div class="panel-body" style="height: 900px;">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered bootstrap-datatable datatable" border="1">
                        <thead>
                        <tr>
                            <th>产品编号</th>
                            <th>商品类型编号</th>
                            <th>库存</th>
                            <th>总金额</th>
                            <th>编辑</th>
                        </tr>
                        </thead>
                        <tbody>

                        <<tr th:each="entries,stat: ${deviceUserecordCustomList.list}">
                            <tr>
                                <td th:text="${entries.goodsId }"></td>
                                <td th:text="${entries.goodsTypeId }"></td>
                                <td th:text="${entries.stock }"></td>
                                <td>
                                    <span class="label label-warning" th:text="${entries.totalPrice }"></span>
                                </td>
                                <td>
                                    <a th:href="'/goodsinfo/get/' + ${entries.id}" th:text="编辑"></a>
                                    <a th:href="'/goodsinfo/del/' + ${entries.id}" th:text="删除" th:onclick="'javascript:return delAllData();'"></a>
                                </td>
                            </tr>

                        </tbody>
                    </table>
                    <!-- 分页 -->

                    <div class="modal-footer no-margin-top">
                        <ul class="pagination pull-right no-margin">

                            <!-- 首页 -->
                            <li>
                                <a th:href="'/goodsinfo/query?pageNum=0'">首页</a>
                            </li>

                            <!-- 上一页 -->
                            <li th:if="${deviceUserecordCustomList.hasPreviousPage}">
                                <a th:href="'/goodsinfo/query/' + ${deviceUserecordCustomList.hasPreviousPage}" th:text="上一页"></a>
                            </li>

                            <!-- 中间页 -->
<!--                            <li th:each="pageNum:${#numbers.sequence(0, deviceUserecordCustomList.list.getTotalPages() - 1)}">-->
<!--                                <a th:href="'/query?pageNum=' + ${pageNum}" th:text="${pageNum + 1}" th:if="${pageNum ne deviceUserecordCustomList.list.pageable.getPageNumber()}"></a>-->
<!--                                <a th:href="'/query?pageNum=' + ${pageNum}" th:text="${pageNum + 1}" th:if="${pageNum eq deviceUserecordCustomList.list.pageable.getPageNumber()}" th:style="'font-weight:bold;background: #6faed9;'"></a>-->
<!--                            </li>-->

                            <!-- 下一页 -->
                            <li th:if="${deviceUserecordCustomList.hasNextPage}">
                                <a th:href="'/goodsinfo/query/' + ${deviceUserecordCustomList.nextPage}" th:text="下一页"></a>
                            </li>

                            <!-- 尾页 -->
                            <li>
                                <a th:href="'/goodsinfo/query/' + ${deviceUserecordCustomList.total}">尾页</a>
                            </li>

                        </ul>
                    </div>
<!--                    <div class="message">-->
<!--                        共<i class="blue">${pagehelper.total}</i>条记录，当前显示第&nbsp;<i-->
<!--                            class="blue">${pagehelper.pageNum}/${pagehelper.pages}</i>&nbsp;页-->
<!--                    </div>-->
<!--                    <div style="text-align:center;">-->
<!--                        <ul class="pagination">-->
<!--                            <span th:if="${!pagehelper.isFirstPage}">-->
<!--                                <li><a href="javascript:queryDeviceRecords(${pagehelper.firstPage});">首页</a></li>-->
<!--                                <li><a href="javascript:queryDeviceRecords(${pagehelper.prePage});">上一页</a></li>-->
<!--                            </span>-->
<!--                            <span th:forEach items="${pagehelper.navigatepageNums}" var="navigatepageNum">-->

<!--                                <span th:if="${navigatepageNum==pagehelper.pageNum}">-->
<!--                                    <li class="active"><a href="javascript:queryAllDevices(${navigatepageNum});">${navigatepageNum}</a></li>-->
<!--                                </span>-->
<!--                                <span th:if="${navigatepageNum!=pagehelper.pageNum}">-->
<!--                                    <li><a href="javascript:queryDeviceRecords(${navigatepageNum});">${navigatepageNum}</a></li>-->
<!--                                </span>-->
<!--                            </span>-->
<!--                            <span th:if="${!pagehelper.isLastPage}">-->
<!--                                <li><a href="javascript:queryDeviceRecords(${pagehelper.nextPage});">下一页</a></li>-->
<!--                                <li><a href="javascript:queryDeviceRecords(${pagehelper.lastPage});">最后一页</a></li>-->
<!--                            </span>-->
<!--                        </ul>-->
<!--                    </div>-->
                </div>
            </div>
        </div>
    </div>
</div>


<!--<table border="1">-->
<!--    <tr>-->
<!--        <th>ID</th>-->
<!--        <th>Name</th>-->
<!--        <th>Age</th>-->
<!--    </tr>-->
<!--    <tr th:each="u : ${deviceUserecordCustomList}">-->
<!--        <td th:text="${u.goodsId}"></td>-->
<!--        <td th:text="${u.goodsId}"></td>-->
<!--        <td th:text="${u.goodsId}"></td>-->
<!--    </tr>-->
<!--</table>-->
</body>
</html>